<html>
  <head>
    <title>Create A New User</title>
    <%= stylesheet_link_tag "recipe" %>
  </head>
<h1>Create A New Account</h1>

  <% if session[:user_name] == "Admin" %>
<p>User session id:<%= session[:user_id] %></p>
<p>User_name: <%= session[:user_name] %> </p>
  <% end %>


<% form_for(@user) do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :user_name %><br />
    <%= f.text_field :user_name %>
  </p>
  <p>
    <%= f.label :password %><br />
    <%= f.text_field :password %>
  </p>
  <p>
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </p>
  <p>
    <%= f.label :region %><br />
    <%= f.text_field :region %>
  </p>
  <p>
    <%= f.label :birthday %><br />
    <%= f.date_select :birthday, :start_year =>1980, :order => [:month, :day, :year] %>
  </p>
<!-- Only the Admin can see this option-->
     <% if session[:is_admin] == true %>
  <p>
    <%= f.label :admin %><br />
    <%= f.check_box :admin %>
  </p>
  <% else %>
  Thank you for joining us! <!-- This message is shown to non-admin users -->
   
  <% end %>

  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Main Page', :controller => 'recipe', :action => 'index' %>
</html>
